package demo1;

import java.util.Comparator;

public class NameComparator implements Comparator<Stu> {
    public int compare(Stu stu3,Stu stu4){
        return stu3.name.compareTo(stu4.name);//借助Comparator接口实现自定义比较规则
    }

}
